package com.wswy.wyjk;

import android.app.Activity;
import android.content.Context;

import com.baidu.mobstat.StatService;
import com.raft.framework.BaseAppContext;
import com.wswy.wyjk.ui.uitls.ChannelManager;

public class BasePartyAppContext extends BaseAppContext {

    @Override
    protected void initMainProcess() {
        super.initMainProcess();

        boolean debug = isDebug();

        String channel = ChannelManager.getChannel();

        StatService.setDebugOn(debug);

        StatService.setAppChannel(this,channel,true);
        StatService.autoTrace(this, true, false);
        StatService.start(this);

        UpgradeConfigure.init(this);
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        UpgradeConfigure.installTinker();
    }

    @Override
    public void onActivityPaused(Activity activity) {
        super.onActivityPaused(activity);
        if (activity != null){
            StatService.onPause(activity);
        }
    }

    @Override
    public void onActivityResumed(Activity activity) {
        super.onActivityResumed(activity);
        if (activity != null){
            StatService.onResume(activity);
        }
    }


    public String getAppKey(String appKeyName){
        return null;
    }

    public interface ConfigureKeys{
        String BUGLY_APPID="bugly_appid";
        String BAIDU_MTJ_APPID = "baidu_mtj_appid";
    }

}
